# coding: utf-8
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
from qelwidgets import PictureBrowserView


class PictureBrowserDemo(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Picture Browser Demo")
        self.picture_browser = PictureBrowserView(self)
        self.setCentralWidget(self.picture_browser)

        # urls = [
        #     'https://i0.hdslb.com/bfs/article/49b9240d91cd233adb878f316b88cee73d51828f.jpg',
        #     'http://gd-hbimg.huaban.com/319e4c01dd966cf2626af0d5449f3f3f254014ce258774-BhSHkW',
        #     'https://gd-hbimg.huaban.com/41a5264343cc03568e0fa239991f3a268ec1cbc2d46b0c-Dn3S8Y',
        #     'http://hbimg.huaban.com/e781a742735b2e8a9ba75e9d5ce5151ac6befcb3420e4f-rTBmXX',
        #     'https://gd-hbimg.huaban.com/522bf176ac4887b0c4b120d4a67a752231f80acc16e88f-KEgQ6g',
        # ]
        # self.picture_browser.setPixmaps(urls, 2)
        self.picture_browser.setPixmaps([
            './9A351CDA453872C7D495FD406843F2B5.jpg',
            './77FAA7D1814A28F37E02273DB0E72041.jpg'
        ])


if __name__ == '__main__':
    app = QApplication([])
    demo = PictureBrowserDemo()
    demo.resize(800, 600)
    demo.show()
    app.exec()
